﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IChessEngine;
using ChessEngine.Basic;
using ChessEngine.Gaming;
using ChessEngine.PositionTree;

namespace ChessEngine
{
    public class ChsFactory
    {
        public static IChsSquare CreateSquare(int x, int y)
        {
            return new ChsSquare(x, y);
        }
        public static IChsMovement CreateMovement(IChsSquare source, IChsSquare target, EChsPieceType eChsPieceType)
        {
            return new ChsMovement(source, target, eChsPieceType);
        }
        public static IChsMovement CreateMovement(IChsSquare source, IChsSquare target)
        {
            return new ChsMovement(source, target);
        }
        public static IChsValidator CreateValidator()
        {
            return new ChsValidator();
        }
        public static IChsGameMovement CreateGameMovement(IChsSquare source, IChsSquare target, EChsPieceType eChsPieceType, Guid sourcePositionId, Guid targetPositionId)
        {
            return new ChsGameMovement(source, target, eChsPieceType, sourcePositionId, targetPositionId);
        }
        public static IChsGame CreateGame(  Guid _id,
                                            string _whitePlayer,
                                            string _blackPlayer,
                                            DateTime _date)
        {
            ChsGame game = new ChsGame();
            game.Id = _id;
            game.WhitePlayer = _whitePlayer;
            game.BlackPlayer = _blackPlayer;
            game.Date = _date;
            return game;
        }
        internal static IChsPosition CreatePosition()
        {
            return new ChsPosition();
        }
        internal static IChsGamePosition CreateGamePosition(IChsPosition position)
        {
            return new ChsGamePosition(position);
        }
        internal static IChsPosition CreatePosition(IChsPosition position)
        {
            return new ChsPosition(position);
        }
        internal static IChsMovement CreateMovement(IChsMovement _movement)
        {
            return new ChsMovement(_movement);
        }
        internal static IChsMovementKey CreateMovementKey(Guid _sourcePositionId, Guid _targetPositionId)
        {
            return new ChsMovementKey(_sourcePositionId, _targetPositionId);
        }
        internal static IChsGamePosition CreateGamePosition(Guid _id, IChsPosition _position)
        {
            return new ChsGamePosition(_id, _position);
        }
        internal static IChsPositionRepository CreatePositionRepository()
        {
            return new ChsPositionRepository();
        }
        internal static IChsMovementRepository CreateMovementRepository()
        {
            return new ChsMovementRepository();
        }
        internal static IChsGameMovement CreateGameMovement(IChsMovement movement, Guid sourcePositionId, Guid targetPositionId)
        {
            return new ChsGameMovement(movement, sourcePositionId, targetPositionId);
        }
    }
}
